import file_monitor
import box
from dropboxCloud import dropbox

cloud = dropbox.DropboxCloud(dropbox.APP_KEY, dropbox.APP_SECRET)

def addfunc(path):
	cloud.do_put(path, path)
	print "(A) ", path

def removedfunc(path):
    print "(R) ", path
    
def updatedfunc(path):
    print "(U) ", path   

def main():
    fm = file_monitor.FileMonitor()
    
    fm.registerNewFileListener(addfunc)
    fm.registerRemovedFileListener(removedfunc)
    fm.registerUpdatedFileListener(updatedfunc)
    
    fm.start()
    
    print "System Started"
    
    new_path = raw_input("Path to Monitor: ")
    while(new_path):
        fm.track(new_path)
        new_path = raw_input("Path to Monitor: ")
    
    fm.cancel()
    

if __name__ == "__main__":
    main()
